import { Observable } from 'rxjs'

import { IRoleQueryParams, IRolePagination, IMenu, Role, IRoleUpdate } from '@shared/interfaces/role'
import { IQueryParams } from '@shared/interfaces/queryParams'
import { IUserPagination } from '@shared/interfaces/user'

export abstract class RoleService {
  abstract getList(params: IRoleQueryParams): Observable<IRolePagination>

  abstract getRoleById(roleId: number): Observable<Role>

  abstract getUsersOfOneRole(params: IQueryParams, roleId: number, str?: string): Observable<IUserPagination>

  abstract updateRole(roleId: number, data: IRoleUpdate): Observable<Role>

  abstract getMenus(): Observable<IMenu[]>

  abstract createRole(role: IRoleUpdate): Observable<boolean>

  abstract deleteRole(roleId: string): Observable<boolean>

  abstract updateMenusOfRole(roleId: number, menus: number[]): Observable<boolean>

  abstract freeze(roleId: number): Observable<boolean>

  abstract unfreeze(roleId: number): Observable<boolean>
}
